package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.AreaEntity;
import com.py.credit.entity.Database;
import com.py.credit.entity.SContentInfo;
import com.py.credit.entity.TableResult;
import com.py.credit.entity.common.TreeObj;
import com.py.framework.core.common.Page;

public interface ContentDao {

	void addCommonContent(@Param(value = "list") List<TreeObj> contentNode, @Param(value = "infoId") int infoId);

	int addBookCommonContentInfo(SContentInfo sContentInfo);

	void addBookCommonContent(@Param(value = "list") List<TreeObj> contentNode, @Param(value = "infoId") int infoId);

	List<TreeObj> selectCommonContentTree();

	void addContentRegion(@Param(value = "regionKey") long regionKey, @Param(value = "contentId") int contentId,
			@Param(value = "userId") long userId, @Param(value = "deptId") long deptId);

	List<TreeObj> selectCommonContentInUse(@Param(value = "rootId") String rootId,
			@Param(value = "sharingType") String sharingType,
			@Param(value = "informationType") String informationType);

	List<TreeObj> selectCollectingContent(@Param(value = "list") List<Database> dataBase);

	void delBookContentInfo(@Param(value = "list") String[] idArray);

	/**
	 * @param idArray
	 */
	void delBookContent(@Param(value = "list") String[] idArray);

	List<Map<String, Object>> selectBookContentListByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> condition, @Param(value = "page") Page page,
			@Param(value = "regionId") long regionId);

	void updateBookContent(SContentInfo sContentInfo);

	List<TreeObj> selectBoookContentDetail(@Param(value = "infoId") int id);

	/**
	 * @param id
	 * @return
	 */
	SContentInfo selectBookContenInfo(@Param(value = "id") int id);

	/**
	 * @param id
	 * @param status
	 */
	void updateBookContentStatus(@Param(value = "id") String id, @Param(value = "status") String status);

	List<Map<String, Object>> selectSubscriptionInfo(@Param(value = "id") String id);

	/**
	 * @return
	 */
	List<TreeObj> selectDbNode();

	/**
	 * @param deptNodes
	 * @return
	 */
	List<TreeObj> selectCubeNodes();

	/**
	 * @param cubeNodes
	 * @return
	 */
	List<TreeObj> selectMetricNodes(@Param(value = "list") List<TreeObj> cubeNodes);

	/**
	 * @param sContentInfo
	 * @return
	 */
	int addCommonContentInfo(SContentInfo sContentInfo);

	/**
	 * @param status
	 * @param id
	 */
	void updateCommonContentStatus(@Param(value = "status") String status, @Param(value = "id") int id);

	/**
	 * 功能描述: 把不是当前的状态改为flase
	 *
	 * @param id 启用状态的id
	 * @author YaoS
	 * @date 19/4/4 14:30
	 */
	void forbiddenCommonContent(@Param(value = "id") Integer id);

	/**
	 * @param tableId
	 * @param contentId
	 * @return
	 */
	TableResult selectTableColumns(@Param(value = "tableId") Integer tableId,
			@Param(value = "contentId") Integer contentId, @Param(value = "tipId") String tipId);

	/**
	 * @param areaId
	 * @return
	 */
	List<TreeObj> selectBoookContentByRegionId(@Param(value = "regionId") String regionId);

	/**
	 * @return
	 */
	List<TreeObj> selectCommonContent(@Param(value = "kId") String kId);

	/**
	 * @return
	 */
	SContentInfo selectCommonContentInfo();

	List<Map<String, Object>> selectContentResouceNum(@Param(value = "kId") String kId);

	/**
	 * @param kId
	 * @return
	 */
	List<Map<String, Object>> selectBoookContentReourceNumByRegionId(@Param(value = "kId") String kId,
			@Param(value = "regionKey") String regionkey);

	/**
	 * @return
	 */
	List<Map<String, Object>> selectCommonContentTableNum();

	/**
	 * @return
	 */
	List<TreeObj> selectCommonContentDept();

	/**
	 * @param regionKey
	 * @param contentId
	 */
	void delContentRegion(@Param(value = "regionKey") long regionKey, @Param(value = "contentId") int contentId);

	/**
	 *
	 */
	void clearCommonContent();

	/**
	 *
	 */
	void clearCommonContentInfo();

	/**
	 * @param showColumns
	 * @param additioanlColumns
	 * @param conditions
	 * @param page
	 * @return
	 */
	List<Map<String, Object>> selectCommonContentListByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> condition, @Param(value = "page") Page page);

	/**
	 * @param id
	 * @return
	 */
	List<TreeObj> selectCommonContentDetail(@Param(value = "id") int id);

	/**
	 * @param id
	 * @return
	 */
	SContentInfo selectCommonContentInfoById(@Param(value = "id") int id);

	/**
	 * @param id
	 * @return
	 */
	List<TreeObj> selectEditCommonContentTree(@Param(value = "id") int id);

	/**
	 * @param sContentInfo
	 */
	void updateCommonContent(SContentInfo sContentInfo);

	/**
	 * @param ids
	 */
	void delCommonContent(@Param(value = "list") String[] ids);

	/**
	 * @param idArray
	 */
	void delCommonContentInfo(@Param(value = "list") String[] idArray);

	/**
	 * @param id
	 * @param checkStatus
	 */
	void checkCommonContent(@Param(value = "id") String id, @Param(value = "checkStatus") String checkStatus);

	/**
	 * @return
	 * @Author YaoS
	 * @Description //TODO
	 * @Date 15:00 18/9/28
	 * @Param
	 **/
	TableResult selectExcel(@Param(value = "tableId") Integer tableId, @Param(value = "title") String title);

	
	/**
	 * @Title: getAllArea
	 * @Description: TODO(这里用一句话描述这个方法的作用)
	 * @param @return    设定文件
	 * @return List<AreaEntity>    返回类型
	 * @throws
	*/
	
	List<AreaEntity> getAllArea();

}